{if $params.action=="add" || $params.action=="edit"}
	{$Form}
{/if}

{if $params.action=="view"}

	<div id="Categories">

		<p class="ui-buttonset">
			{if $CategoryInfo.acl.mvc.add && $CategoryInfo.acl.category>900}
				<a href="{$view->siteUrl()}/control/categories/add/categoryid/{$CategoryInfo.categoryid}/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-plusthick"></span><span class="ui-button-text">{$translate->_('Создать подраздел')}</span></a>
			{/if}
			{if $CategoryInfo.acl.mvc.edit && $CategoryInfo.acl.category>900}
				<a href="{$view->siteUrl()}/control/categories/edit/categoryid/{$CategoryInfo.categoryid}/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-pencil"></span><span class="ui-button-text">{$translate->_('Редактировать')}</span></a>
			{/if}
			{if $CategoryInfo.acl.mvc.delete && $CategoryInfo.clevel>0 && $CategoryInfo.acl.category>900}
				<a href="{$view->siteUrl()}/control/categories/delete/categoryid/{$CategoryInfo.categoryid}/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-close"></span><span class="ui-button-text">{$translate->_('Удалить')}</span></a>
			{/if}
			{if $CategoryInfo.acl.mvc.move && $CategoryInfo.clevel>0 && $CategoryInfo.acl.category>900}
				<a href="{$view->siteUrl()}/control/categories/move/categoryid/{$CategoryInfo.categoryid}/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all move"><span class="ui-icon ui-icon-transferthick-e-w"></span><span class="ui-button-text">{$translate->_('Переместить')}</span></a>
			{/if}
			{if $CategoryInfo.acl.mvc.shift && $CategoryInfo.clevel>0 && $CategoryInfo.acl.category>900}
				<a href="{$view->siteUrl()}/control/categories/shift/direction/up/categoryid/{$CategoryInfo.categoryid}/" class="category-shift ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-arrowthick-1-n"></span><span class="ui-button-text">{$translate->_('Сдвинуть вверх')}</span></a>
				<a href="{$view->siteUrl()}/control/categories/shift/direction/down/categoryid/{$CategoryInfo.categoryid}/" class="category-shift ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-arrowthick-1-s"></span><span class="ui-button-text">{$translate->_('Сдвинуть вниз')}</span></a>
			{/if}
		</p>
		
		<dl>
			<dt class="first ui-widget-content">{$translate->_('Путь раздела')}</dt>
			<dd class="first ui-widget-content"><a href="{$view->siteUrl()}{$CategoryInfo.fullpath}" target="_blank">{$CategoryInfo.fullpath}</a></dd>
			<dt class="ui-widget-content">Видимость</dt>
			<dd class="ui-widget-content">{if $CategoryInfo.visible=='yes'}{$translate->_('Да')}{else}{$translate->_('Нет')}{/if}</dd>
			{if $CategoryInfo.modulename}
				<dt class="ui-widget-content">{$translate->_('Модуль материалов')}</dt>
				<dd class="ui-widget-content"><a href="{$view->siteUrl()}/control/resource/index/moduleid/{$CategoryInfo.moduleid}/">{$CategoryInfo.modulename}</a></dd>
			{/if}
			{if $CategoryInfo.widgetssetname}
				<dt class="ui-widget-content">{$translate->_('Внешний вид')}</dt>
				<dd class="ui-widget-content">{$CategoryInfo.widgetssetname}</dd>
			{/if}
			{if $CategoryInfo.mainresourcename}
				<dt class="ui-widget-content">{$translate->_('Материал для замещения')}</dt>
				<dd class="ui-widget-content">{$CategoryInfo.mainresourcename}</dd>
			{/if}
			<div class="clear"></div>
		</dl>
		
		{if $CategoryInfo.modulename}
			<h3>
				{$translate->_('Список')} {$CategoryInfo.modulegenetivename} {$translate->_('в разделе')} &nbsp;
				<a href="{$view->siteUrl()}/control/resource/add/moduleid/{$CategoryInfo.moduleid}/categoryid/{$CategoryInfo.categoryid}/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-plusthick"></span><span class="ui-button-text">{$translate->_('Добавить')} {$CategoryInfo.modulesinglename}</span></a>
			</h3>
			{$ResourceDataTable}
		{/if}
	
	</div>
	
	<script type="text/javascript">
		$(document).ready(function(){
			$('.ui-button.move').click(function(){
				$('#MoveCategory > form').phormDialog({
					title: '{_("Перемещение раздела")}'
				});
				return false;
			});
		});
	</script>
	
	<div id="MoveCategory" class="hidden">{$MoveForm}</div>

{/if}
